//
//  Common.swift
//  EyeVisionForPatients
//
//  Created by PMC on 2020/2/7.
//  Copyright © 2020 tao Tao. All rights reserved.
//

import UIKit

// MARK: - 全局导入三方库
@_exported import IQKeyboardManagerSwift
@_exported import SnapKit
@_exported import Kingfisher

let screenW: CGFloat = UIScreen.main.bounds.width
let screenH: CGFloat = UIScreen.main.bounds.height

let iPhoneX: Bool = screenH >= 812 ? true : false

let tabBarH: CGFloat = iPhoneX ? 83.0 : 49.0
let navBarH: CGFloat = iPhoneX ? 88.0 : 64.0
let bottomSafeH: CGFloat = iPhoneX ? 34.0 : 0.0
let topSafeH: CGFloat = iPhoneX ? 44.0 : 20.0

var mainWindow: UIWindow { return (AppDelegate.share()?.window)! }

struct NotiName {
    static let refreshData = Notification.Name("refreshData")
    
    /// 接收到消息
    static let receiveMessage = Notification.Name("receiveMessage")
    /// 发送消息失败
    static let sendMessageFail = Notification.Name("sendMessageFail")
    
    /// 结束咨询
    static let endAdvisory = Notification.Name("endAdvisory")
    
    // MARK: - 微信支付成功
    static let wechatPaySuccess = Notification.Name("wechatPaySuccess")
    static let wechatPayFailure = Notification.Name("wechatPayFailure")
    
    /// 订单支付完成界面点击确认回到响应诊断列表
    static let surePayResult = Notification.Name("surePayResult")
    
    /// 友盟推送消息
    static let umpushMessage = Notification.Name(rawValue: "umpushMessage")
    
    //语音播放开始
    static let audioPlayBegin = Notification.Name("audioPlayBegin")
    //语音播放结束
    static let audioPlayEnd = Notification.Name("audioPlayEnd")
    
    //监听用户是否贴近听筒
    static let UIDeviceProximityState = Notification.Name("UIDeviceProximityStateDidChangeNotification")
    
    /// 登录成功
    static let loginSuccess = Notification.Name("loginSuccess")
}

// MARK: - 云视讯
// SDK 授权
let kYSXSDKAppKey = "6UHA0oCNrQcUflib7UuOXAYCTsMis0kMrQGp"
let kYSXSDKAppSecret = "PJ3JRixfdD70jE6b2Ef5YiaX6PxTpbYLyPjZ"

let kWeChatAppID = "wx5bc770d09dac9334" //测试

// MARK: - UMPush
let kUMAppKey = "5e86d5a2978eea071c37bf3d"

// MARK: - 高德key

// MARK: - WeChat
#if DEVELOPER
let mapAppKey = "724c1d30e28de34db1c1357f9cf78753" //测试
#else
let mapAppKey = "13a764208dc9897faca5a53a2273c9e0" //生产
#endif

public var clSafeAreaInsets: UIEdgeInsets {
    return UIApplication.shared.windows.first?.safeAreaInsets ?? .zero
}
